<!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <title>Push Notification with clients management - ServiceWorker Cookbook</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <style>
    body {
      font-family: monospace;
      font-size: 1rem;
      white-space: pre-wrap;
    }
  </style>
</head>
<body>
<p>This demo shows how to control the clients of a service worker when the user clicks on a push notification.</p>

<p>Press on 'Send notification' and try one of:</p>
<ul>
  <li>- Switching to another page: clicking on the notification will re-focus this page;</li>
  <li>- Closing this page: clicking on the notification will reopen it;</li>
  <li>- Remaining on this page: a different notification will be shown, nothing will happen if you click on it.</li>
</ul>

<button id="doIt">Send notification</button>

<script src="/tools.js"></script>
<script src="./index.js"></script>
</body>
</html>
